package com.ruoyi.wechat.api;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wechat.domain.Banner;
import com.ruoyi.wechat.service.IBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wechat/banner")
public class WxBannerController extends BaseController {
    @Autowired
    private IBannerService bannerService;

    @GetMapping("list")
    public TableDataInfo list(Banner banner){
        return getDataTable(bannerService.selectBannerList(banner));
    }
    @GetMapping("{bannerId}")
    public AjaxResult getInfo(@PathVariable("bannerId") Integer bannerId){
        return success(bannerService.selectBannerByBannerId(bannerId));
    }
}
